<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>班级管理</title>
    <link rel="stylesheet" th:href="@{/js/lib/bootstrap/3.3.7/css/bootstrap.min.css}" />
    <link rel="stylesheet"  th:href="@{/js/lib/layui/css/layui.css}"/>
    <link rel="stylesheet" th:href="@{/css/basic_pre.css}" />
    <style>
        #menu1, #menu2, #menu3, #menu4 li {
            text-indent: 1em;
        }
    </style>
</head>
<body>
<nav th:replace="fragment/menu::nav-top"></nav>

<div class="container-fluid" id="app">
    <div class="row">
        <div th:replace="fragment/menu::sys-menu"></div>
        <div class="col-md-8">
            <div style="margin:20px;">
                <div class="sub-header">
                    <h2 class="sub-header-title" v-text="PageObj.title"></h2>
                    <div class="sub-header-nav">
                        <ul class="nav navbar-nav navbar-right">
                            <li><a class="btn-addItem" v-on:click="addItem()">从Excel导入</a></li>
                            <li><a class="btn-addItem" v-on:click="addItem()">新增</a></li>
                        </ul>
                        <div class="navbar-form navbar-right">
                            <input id="search_input" name="search_input" type="text" class="form-control" placeholder="Search..." v-on:change="search(search_input.value);"/>
                        </div>
                    </div>
                </div>
                <div class="panel-body" style="display:none;"></div>
                <data-table :columns="columns" :items="items"></data-table>
                <page-navigation :pageinfo="items.pageInfo"></page-navigation>
                <div-additem :columns="columns" ref="editform_div"></div-additem>
            </div>
            <div class="col-md-2 col-md-offset-10 sidebar">班级排行榜</div>
        </div>
    </div>
</div>
<script th:src="@{/js/lib/jquery.1.8.js}"></script>

<script th:replace="fragment/template4vue::data-table" type="text/x-template"></script>
<script th:replace="fragment/template4vue::page-navigation" type="text/x-template"></script>
<script th:replace="fragment/template4vue::div-additem" type="text/x-template"></script>

<script th:inline="javascript">
/*<![CDATA[*/
    var schoolId = [[${#httpServletRequest.getParameter("schoolId")}]] ? [[${#httpServletRequest.getParameter("schoolId")}]] : "8d27e8166dcd443bab850d33d8634dfb";
    var userId   = "eebbbaf00e9b45a4aeb2ed3f5325b4f7";

    var PageObj = {
        contextPath: $("#contextPath").attr("href") ? $("#contextPath").attr("href") : "",
        title: "学校行政班",
        dataUrl: [[${#httpServletRequest.getContextPath()}]] + "/data/classes?whr-schoolid=" + schoolId + "&page=1&orderBy=classname",
        batch: ["classname"],
        columns: {
            "uuid": {"title":"UUID", "type":"hidden"},
            "classname": {"title":"班级名称","hint":"在名称中可用'#1->9#'样式来批量生成班级,如:2018级会计#1->9#班.",},
            "schoolid": {"title":"学校代码", "type":"hidden", "default":schoolId},
            "schoolname": {"title":"学校名称", "type":"hidden",
                "default":"getValue(PageObj.contextPath + '/data/schools/' + schoolId, 'schoolname', 'schoolname')"
            },
            "allowjoin": {"title":"允许加入", "type":"select", "options":{"0":"不允许", "1":"允许"}, "default":"1"},
            "joincode": {"title":"邀请码", "skip":"order,search", "hint":"不输入则自动生成随机四位数."},
            "status": {"title":"当前状态", "type": "select", "options":{"0":"停用", "1":"正常"}, "default":"1"},
            "create_time": {"title":"创建时间", "type":"hidden"},
            "create_user": {"title":"创建者ID", "type":"hidden", "default":userId},
            "create_username": {"title":"创建者", "type":"text",
                "default":"getValue(PageObj.contextPath + '/data/users/' + userId, 'nick_name', 'create_username')"
            },
        },
        items: "",
    };
/*]]>*/
</script>

<script th:src="@{/js/require.js}" defer="true" async="true" th:attr="data-main=@{/js/pages/PageCommon}"></script>
</body>
</html>